﻿<Window x:Class="DemoDataBinding.ListViewSimple"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ListViewSimple" Height="300" Width="300">
    <Window.Resources>
        <Style TargetType="ListView">
            <Setter Property="Margin" Value="5"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <ListView Grid.Column="0" ItemsSource="{Binding Path=Records}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}"/>
                    <GridViewColumn Header="Increase">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Button Content="{Binding Number}" 
                                        Command="{Binding IncrementCmd}"
                                        MinWidth="50"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <ListView Grid.Column="1" ItemsSource="{Binding Path=Records}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}"/>
                    <GridViewColumn Header="Number" DisplayMemberBinding="{Binding Number}"/>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</Window>
